﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class ModelToolWindow : EditorWindow {
	[MenuItem("Tools/AnimationOperation/抽取动画并生成控制器,并绑定到生成的prefab上(一步到位)", false, 100)]
	public static void Run()
	{
		EditorWindow.GetWindow(typeof(ModelToolWindow), true, "动画操作", true);
	}

	public static bool addKeyFrame=true;
	public static bool addBoxCollider=true;
	public static bool addCapsuleCollider=true;
	public static bool addRigidbody=true;

	void OnGUI()
	{
		GUILayout.Label("选择需要添加的组件", EditorStyles.boldLabel);
		GUILayout.Label("是否需要keyFrameEvent脚本", EditorStyles.boldLabel);
		addKeyFrame= EditorGUILayout.Toggle (addKeyFrame);

		GUILayout.Label("是否需要BoxCollider", EditorStyles.boldLabel);
        addBoxCollider = EditorGUILayout.Toggle (addBoxCollider);

        GUILayout.Label("是否需要CapsuleCollider", EditorStyles.boldLabel);
        addCapsuleCollider = EditorGUILayout.Toggle(addCapsuleCollider);

        GUILayout.Label("是否需要rigidbody", EditorStyles.boldLabel);
		addRigidbody= EditorGUILayout.Toggle (addRigidbody);
		if (GUILayout.Button("开始生成"))
		{
			ModelTool.CreateAniAndCtl ();
		}

	}
}
